<?php 
//basket needs to be prepped so the quantity is updated before 
//the number of items is called in this header script.
//------------------------------------------------------------
Basket::UnsetVars();
$additem						= false;
$action							= Basket::GetAction($_REQUEST);
if($action) {
    Basket::Process();
}
//------------------------------------------------------------

$header_summary_array 	= Basket::Summary();
$header_number_items	= $header_summary_array['quantity'];
//------------------------------------------------------------
?>
<script type="text/javascript">
    navHoverOver = function(id){
        var element = document.getElementById(id).children[0].children[0];
        el(element).css('background-position','0px -39px');
        var element = document.getElementById(id).children[0].children[0].children[0];
        el(element).css('background-position','100% -39px');
    }
    navHoverOut = function(id){
        var element = document.getElementById(id).children[0].children[0];
        el(element).css('background-position','0px -78px');
        var element = document.getElementById(id).children[0].children[0].children[0];
        el(element).css('background-position','100% -78px');
    }
</script>

<div id="header">
    <div id="headerBar">
        <div class="headerWidth">
            <div id="headerLinks">
                <img src="/images/header/servicesbox_left.jpg" style="float:left;" />
                <div style="float:left; margin-top:8px;">
                        <?php /*?><a href="#" id="header_servicesicon"><span>Services</span></a><?php */?>
                    <a href="/basket/" id="header_basket">
                        <?php
                        if ($header_number_items > 1) echo "<span id=\"header_basket_items\">" . $header_number_items . " Artikel</span>";
else if ($header_number_items > 0) echo "<span id=\"header_basket_items\">" . $header_number_items . " Artikel</span>"; 
?>
                    </a>                    
                </div>
                <img src="/images/header/servicesbox_right.jpg" />    
            </div>
            <a href="<?php echo $loc; ?>"><img style="margin-top: 45px; float:left" src="/images/header/logo-klein-allesfuerhandys.gif" height="60%" width="60%" /></a>
            <div style="margin-top:8px; float:right">
                <form id="fullsearch" method="post" action="/fullsearch/">
                    Suche&nbsp;<input name="searchstring" onchange="submit()"/>
                </form>
            </div>
            <img src="/images/header/NexxusLogo.png" style="margin-top:40px; float:right" />
            
        </div>
    </div>
    <div id="headerTabs">
        <div class="headerWidth" style="float: right; margin-right: 7%">
            <div class="ddMenuElement pointer">
                <div><a href="<?php echo $loc; ?>" class="navTabs<?php if(!isset($_GET['c'])) echo "active"; ?>"><span>Home</span></a></div>
            </div>
            <?php  $headerXMLInstance = new OutputXML('web3g/xml/products.xml');
$TLCat = $headerXMLInstance->GetTopLevelCategories();
                foreach($TLCat as $tpl) { ?>
            <div id="dd<?php echo $CleanCode->Encode($tpl); ?>" class="ddMenuElement pointer" onmouseover="dropdown.open({id:'dd<?php echo $CleanCode->Encode($tpl); ?>hover',button:this});navHoverOver('dd<?php echo $CleanCode->Encode($tpl); ?>');">
                    <?php if(isset($_GET['c']) && $_GET['c'] == $CleanCode->Encode($tpl)) { ?>
                <div><a href="/search/<?php echo $CleanCode->Encode($tpl); ?>/" class="navTabsactive"><span><?php echo $tpl; ?></span></a></div>
                        <?php }else { ?>
                <div><a href="/search/<?php echo $CleanCode->Encode($tpl); ?>/" class="navTabs"><span><?php echo $tpl; ?></span></a></div>
        <?php } ?>
                <div id="dd<?php echo $CleanCode->Encode($tpl); ?>hover" class="ddMenuLinksCont hide" onmouseover="dropdown.open({id:'dd<?php echo $tpl; ?>hover',button:null});">
                    <div class="menuShadow">

                        <div class="innerddmenu">
    <?php $MasterCat = $headerXMLInstance->GetMasterCategories($tpl);
    foreach($MasterCat as $mc) { ?>
                            <ul>
                                <li class="subcat"><a href="/search/<?php echo $CleanCode->Encode($tpl); ?>/<?php echo $CleanCode->Encode($mc); ?>/"><?php echo ucwords(strtolower($mc)); ?></a></li>
        <?php $SubCat	= $headerXMLInstance->GetSubCategories($tpl,$mc);
                                        foreach($SubCat as $sc) {?>
                                <li class="menulink"><a href="/search/<?php echo $CleanCode->Encode($tpl); ?>/<?php echo $CleanCode->Encode($mc); ?>/<?php echo $CleanCode->Encode($sc); ?>/"><?php echo ucwords(strtolower($sc)); ?></a></li>
                                        <?php } ?>
                            </ul>
        <?php } ?>
                        </div>
                    </div>

                    <img src="/images/header/menu_shad_btmleft.png" style="float:left;" class="hideIE6" />
                    <div style="height:8px;  width:784px; float:left; background:url('/images/header/menu_shad_btm_vsnglpx.png'); margin-left:8px;" class="hideIE6">&nbsp;</div>
                    <img src="/images/header/menu_shad_btmrght.png" style="float:left;" class="hideIE6" />
                </div>
            </div>
    <?php } ?>
        </div>
    </div>
</div>